// Copyright 2007. Adobe Systems Incorporated. All Rights Reserved.
package fl.controls;
import fl.controls.ScrollBar;
import fl.controls.UIScrollBar;
import fl.controls.ScrollPolicy;
import fl.controls.TextInput; //Only for ASDocs
import fl.core.InvalidationType;
import fl.core.UIComponent;
import fl.events.ComponentEvent;
import fl.events.ScrollEvent;
import fl.managers.IFocusManager;
import fl.managers.IFocusManagerComponent;
import flash.display.DisplayObject;
import flash.events.Event;
import flash.events.TextEvent;
import flash.events.KeyboardEvent;
import flash.events.MouseEvent;
import flash.events.FocusEvent;
import flash.system.IME;
import flash.text.TextField;
import flash.text.TextFieldType;
import flash.text.TextFormat;
import flash.text.TextLineMetrics;
import flash.ui.Keyboard;

extern class TextArea extends UIComponent, implements IFocusManagerComponent {
	public var textField:TextField;
	var _editable:Bool = true;
	var _wordWrap:Bool = true;
	var _horizontalScrollPolicy:String = ScrollPolicy.AUTO;
	var _verticalScrollPolicy:String = ScrollPolicy.AUTO;
	var _horizontalScrollBar:UIScrollBar;
	var _verticalScrollBar:UIScrollBar;
	var background:DisplayObject;
	var _html:Bool = false;
	var _savedHTML:String;
	var textHasChanged:Bool = false;
	static var SCROLL_BAR_STYLES:Dynamic;
	public static function getStyleDefinition():Dynamic;
	public static var createAccessibilityImplementation:Dynamic->Dynamic;
	public function new():Void;
	public var horizontalScrollBar(dynamic, null):UIScrollBar;
	public var verticalScrollBar(dynamic, null):UIScrollBar;
	public var enabled(dynamic, dynamic):Bool;
	public var text(dynamic, dynamic):String;
	public var htmlText(dynamic, dynamic):String;
	public var condenseWhite(dynamic, dynamic):Bool;
	public var horizontalScrollPolicy(dynamic, dynamic):String;
	public var verticalScrollPolicy(dynamic, dynamic):String;
	public var horizontalScrollPosition(dynamic, dynamic):Float;
	public var verticalScrollPosition(dynamic, dynamic):Float;
	public var textWidth(dynamic, null):Float;
	public var textHeight(dynamic, null):Float;
	public var length(dynamic, null):Float;
	public var restrict(dynamic, dynamic):String;
	public var maxChars(dynamic, dynamic):Int;
	public var maxHorizontalScrollPosition(dynamic, null):Int;
	public var maxVerticalScrollPosition(dynamic, null):Int;
	public var wordWrap(dynamic, dynamic):Bool;
	public var selectionBeginIndex(dynamic, null):Int;
	public var selectionEndIndex(dynamic, null):Int;
	public var displayAsPassword(dynamic, dynamic):Bool;
	public var editable(dynamic, dynamic):Bool;
	public var imeMode(dynamic, dynamic):String;
	public var alwaysShowSelection(dynamic, dynamic):Bool;
	public function drawFocus(draw:Bool):Void;
	public function getLineMetrics(lineIndex:Int):TextLineMetrics;
	public function setSelection(setSelection:Int, endIndex:Int):Void;
	public function appendText(text:String):Void;
	function configUI():Void;
	function updateTextFieldType():Void;
	function handleKeyDown(event:KeyboardEvent):Void;
	function handleChange(event:Event):Void;
	function handleTextInput(event:TextEvent):Void;
	function handleScroll(event:ScrollEvent):Void;
	function handleWheel(event:MouseEvent):Void;
	function setEmbedFont():Void;
	function draw():Void;
	function setStyles():Void;
	function drawTextFormat():Void;
	function drawBackground():Void;
	function drawLayout():Void;
	function delayedLayoutUpdate(event:Event):Void;
	function updateScrollBars():Void;
	function needVScroll():Bool;
	function needHScroll():Bool;
	function setTextSize(width:Float, height:Float, padding:Float):Void;
	function isOurFocus(target:DisplayObject):Bool;
	function focusInHandler(event:FocusEvent):Void;
	function focusOutHandler(event:FocusEvent):Void;
}

